import {useDollarGet, useDollarPost} from "~/composables/useDollarFetchRequest"
import {objectToQueryString} from "~/utils/func"

// 钱包概览接口 - 获取可用余额、累计充值、已冻结、已支付等信息
export const getWalletSummaryAPI = async (data) => useDollarGet('/api/finance/wallet/app/summary?' + objectToQueryString(data))

// 钱包流水分页接口 - 获取钱包交易记录
export const getWalletTransactionsAPI = async (data) => useDollarGet('/api/finance/wallet/app/transactions?' + objectToQueryString(data))

// 创建企业账户充值订单
// Request: { amount: number(分), payType: 1|2|4|5, remark?: string }
export const createWalletRechargeOrderAPI = async (data) => useDollarPost('/api/finance/wallet/app/recharge/create', data)

// 查询充值订单支付状态（若后端提供则使用该接口）
// Request: { orderNo?: string, rechargeOrderNo?: string, tradeNo?: string }
export const queryWalletRechargeStatusAPI = async (data) => useDollarPost('/api/finance/wallet/app/recharge/queryStatus', data)
